// run: $exec < input
#include <iostream>
#include <iomanip>

int const maxn = 200;
int a[maxn];
int n;

int main()
{
	std::ios::sync_with_stdio(false);
	int T; std::cin >> T;
	while (T--) {
		std::cin >> n;
		int sum = 0;
		for (int i = 1; i < n; i++) {
			std::cin >> a[i];
			sum += a[i];
		}
		int tmp = 2 * sum / (3 * n - 2);
		int tot = 0;
		for (int i = 1; i < n; i++)
			tot += a[i] == tmp;
		std::cout << tmp << " " << std::fixed << std::setprecision(2) << double(1) / double(tot + 1) << "\n";
	}
}

